#include <iostream>
#include <vector>

using namespace std;

int main(int argc, char const *argv[])
{
  vector<string> v1(3);
  v1[0] = "abc";
  v1[1] = "def";
  v1.push_back("xyz");
// 发现最后一个取值没有取到
  for (int i = 0; i < 3 ;i++) {
    cout << v1[i] << endl;
    cout << "1" <<"\n";
    cout << v1.at(i) << endl;
  }
  // 迭代器遍历 
  vector<string>::iterator it;
  for (it = v1.begin(); it != v1.end(); it ++) {
    cout << *it <<endl;
  }



  return 0;
}
